﻿using FluentValidation;
using Nop.Core.Domain.Customers;
using Nop.Services.Localization;
using Nop.Web.Framework.Validators;
using Nop.Admin.Models.Customers;

namespace Nop.Admin.Validators.Customers
{
    public partial class CustomerInfoVlidator : BaseNopValidator<CustomerInfoModel>
    {
        public CustomerInfoVlidator(CustomerSettings customerSettings)
        {
            RuleFor(x => x.NewPassword).Length(customerSettings.PasswordMinLength, 12).WithMessage(string.Format("密码长度：{0}-12", customerSettings.PasswordMinLength));
            RuleFor(x => x.ConfirmNewPassword).Equal(x => x.NewPassword).WithMessage("两次输入不匹配");
        }}
}